//
//  Book.m
//  xcode717SandBox
//
//  Created by dllo on 16/8/5.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Book.h"

@implementation Book

//取值
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
//        [aDecoder encodeObject:_bookName forKey:@"bookName"];
//        [aDecoder encodeObject:_bookPrice forKey:@"bookPrice"];
//        aDecoder

        _bookName = [aDecoder decodeObjectForKey:@"bookName"];
        _bookPrice = [aDecoder decodeObjectForKey:@"bookPrice"];
        
           }
    return self;
}
//赋值存储
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_bookName forKey:@"bookName"];
    [aCoder encodeObject:_bookPrice forKey:@"bookPrice"];
//    [aCoder setValue:_bookName forKey:@"bookName"];
//    [aCoder setValue:_bookPrice forKey:@"bookPrice"];
}
@end
